<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="vtc" uri="/ls-trade-tags"%>
<%@ include file="/common/taglibs.jsp"%>


<html>
<head>
	<title>编辑产品</title>
	<%@ include file="/common/meta.jsp" %>
	<%@ include file="/common/css_js.jsp"%>	
	
	<script type="text/javascript">
	
		$(document).ready(function() {
			$("#mainForm").validate();
		});

		function clickBtn(action,id,e){
			
			switch(action){
			case "close":
				$(".aniBox",window.parent.document).remove();
				$(".winMask",window.parent.document).remove();
				$(".popup",window.parent.document).remove();

				return;
				
			case "save":
				$("#mainForm").attr("action","product!save.action");
				break;	
			}
			
			$("#mainForm").submit();
		}	

	</script>
</head>
<body>
	<s:if test="%{product!=null&&product.id!=null}">
		<div class="pageTitle">编辑产品</div>
	</s:if>
	<s:else>
		<div class="pageTitle">添加产品</div>
	</s:else>	
  	
  
    <s:form id="mainForm" name="mainForm" action="product!save.action" method="post" target="_parent">
    <s:hidden name="product.id" id="productId"></s:hidden>
    <s:hidden name="product.version" id="productVersion"></s:hidden>
    	
   	 <div class="form2">
   	 
      <table cellspacing="0" cellpadding="0" border="0">
        <tbody><tr>
          <td class="sep"><img style="width:180px;" src="../images/spacer.gif"></td>
          <td class="sep sep2"><img src="../images/spacer.gif"></td>
        </tr>
        <tr>
          <td><label class="fLabel">类型</label>
            <div class="fField">
				 <s:select cssClass="inputSelect required" cssStyle="width:180px" name="product.type" 
				            		  list="%{getParamsByType('PRODUCT_TYPE')}" listKey="code" listValue="label"
				            		  headerKey="" headerValue="-- Select --">
				</s:select>            
            </div>
          </td>
        
          <td><label class="fLabel">单位</label>
            <div class="fField">
              <s:textfield cssClass="inputText required" cssStyle="width:180px" name="product.unit"/>
           </div></td>  
        </tr>
        <tr>
          <td><label class="fLabel">产品名</label>
            <div class="fField">
	            <s:textfield cssClass="inputText required" cssStyle="width:180px" name="product.name"/>
            </div>
          </td>      
          <td><label class="fLabel">代码</label>
            <div class="fField">
              <s:textfield cssClass="inputText required" cssStyle="width:180px" name="product.code"/>
           </div></td>

        </tr>   
        <tr>
          <td><label class="fLabel">默认单价</label>
            <div class="fField">
	            <s:textfield cssClass="inputText required number" cssStyle="width:180px" name="product.defaultPrice"/>
            </div>
          </td>
          <td><label class="fLabel">规格</label>
            <div class="fField">
	            <s:textfield cssClass="inputText required" cssStyle="width:180px" name="product.specifications"/>
            </div>
          </td>
        </tr>               
      </tbody>
      </table>
      
      <div class="btnSet btnSetTypeA">
       	  <div class="left">
				<div class="button">
	              <div class="left">
	                <div class="right">
	                  <input type="button" onclick="clickBtn('save')" value="保存" class="inputButton">
	                </div>
	              </div>
	            </div>    
	            
	           <div class="button">
	             <div class="left">
	               <div class="right">
	               	 <input type="reset" value="重置"  class="inputButton">
	               </div>
	             </div>
	           </div>  	
	      
	          <div class="button">
	            <div class="left">
	              <div class="right">
	                <input type="button" onclick="clickBtn('close')" value="关闭" class="inputButton">
	              </div>
	            </div>
	          </div>
	          
          </div>
        </div>
     
   </div>
 
	   
   </s:form>

</body>
</html>